<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib  uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
 <link href="css/table.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
 <script type="text/javascript" src="js/openwindow.js"></script>
 <script type="text/javascript">

function saveFormProporty(){
	var proportyName =$("#proportyName").val();
	var proportyType =$("#proportyType").val();
	if($.trim(proportyName)=='null' || $.trim(proportyName)==''){
		alert("字段名称不能为空！");
		return;
	}
	if($.trim(proportyType)=='null' || $.trim(proportyType)==''){
		alert("请选择字段类型");
		return;
	}
	$.post("updateFlowFormProporty.action",$("form").serialize(),function(data){
			if(data=='success'){
				alert("操作成功！");
				window.close();
				window.opener.location.reload();
			}else{
				alert("操作失败！");
			}
		});	
	
}	

function changeType(val){
	if(val=='int'){
		$("#proportyLen").val(8);
	}else if(val=='float'){
		$("#proportyLen").val(10);
	}else if(val=='string'){
		$("#proportyLen").val(255);
	}else{
		$("#proportyLen").val(50);
	}
}
 </script>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td> 系统管理 &gt; 自定义平台 &gt; 数据库管理 &gt;字段管理&gt; 添加</td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
    <input type="hidden" id="array" >
    <form action="" method="post" name="saveMemoForm" id="saveMemoForm">
     <input type="hidden" name="formProporty.id" value="${formProporty.id}">
    <input type="hidden" name="formProporty.formid" value="${formProporty.formid}">
    <input type="hidden" name="formProporty.formName" value="${formProporty.formName}">
    <input type="hidden" name="formProporty.userName" value="${formProporty.userName}">
    <input type="hidden" name="formProporty.createTime" value="${formProporty.createTime}">
    <table width="100%" style="margin-top: 10px" class="table5 bgcolor5">
    	<tr><td  class="table5 bgcolor5" width="24%">字段名称</td>
    	<td class="table5" colspan="3">
    		<input  name="formProporty.proportyName" value="${formProporty.proportyName}"  maxlength="20"  size="40" id="proportyName" type="text"/>
    	</td></tr>
    	<tr><td  class="table5 bgcolor5" width="24%">系统名称</td>
    	<td class="table5" colspan="3">
    		<input  name="formProporty.columnName" readonly="readonly" value="${formProporty.columnName}"  maxlength="20"  size="40"   type="text"/>
    	</td></tr>
    	<tr><td class="table5 bgcolor5">字段类型</td><td class="table5" colspan="3">
    	<s:select list="#{'int':'整型','float':'浮点型','string':'字符型','text':'文本型'}"   cssErrorStyle="width:160px" headerKey="" headerValue="--请选择--" id="proportyType" onchange="changeType(this.value)" name="formProporty.proportyType" value="formProporty.proportyType" theme="simple"></s:select>
    	</td></tr>
    	<tr><td class="table5 bgcolor5">字段长度</td>
    	<td class="table5" colspan="3">
    		<input  readonly="readonly"  name="formProporty.proportyLen" value="${formProporty.proportyLen}"  maxlength="20"  size="40" id="proportyLen" type="text"/>
    	 </td></tr>
    	 <tr><td class="table5 bgcolor5">编辑方式</td>
    	<td class="table5" colspan="3">
    	<s:select list="#{'input':'标准输入','date':'时间','word':'Word编辑','upload':'上传','textarea':'多行文本','opinion':'批示意见','org':'登录人部门','user':'登录人姓名'}" cssErrorStyle="width:160px"  name="formProporty.type" value="formProporty.type" theme="simple"></s:select>
    	 </td></tr>
    	 <tr><td class="table5 bgcolor5">字段说明</td>
    	<td class="table5" colspan="3">
    		<textarea rows="4" cols="50" onkeyup="textLength(this,100)" name="formProporty.content">${formProporty.content}</textarea>
    	 </td></tr>
    	 	<tr><td class="table5 bgcolor5">允许空</td>
    	<td class="table5" colspan="3">
    		<s:radio list="#{'0':'是','1':'否'}" name="formProporty.valueNull"  value="formProporty.valueNull"  theme="simple"></s:radio>
    	 </td></tr>
    	<tr><td align="center" colspan="4"><input onclick="saveFormProporty()" class="button_02" value="保存" type="button" >&nbsp;<input class="button_02" type="button" value="退出" onclick="window.close()" > </td></tr>
    </table>
    </form>
    </td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
</body>
</html>